// Package worker defines the worker interface for GoCelery
package worker

import "gitee.com/yuebanlaosiji/gocelery/pkg/types"

// TaskFunc is a function that processes a task
type TaskFunc func(args []interface{}, kwargs map[string]interface{}) (interface{}, error)

// WorkerStatus represents the current status of a worker
type WorkerStatus struct {
	Running        bool
	ActiveTasks    int
	TasksProcessed int
}

// Worker is the interface for task processing
type Worker interface {
	// Register a task handler
	Register(name string, handler types.TaskFunc) error

	// Start processing tasks
	Start() error

	// Stop processing tasks
	Stop() error

	// Get worker status
	Status() WorkerStatus
}
